package tech.aistar.day06.biz;

/**
 * 本类用来演示: 业务类
 *
 * @author: success
 * @date: 2021/3/15 9:43 上午
 */
public class AccountBiz {

    public void saveMoney(Account acc,double money){
        //参数校验
        if(money<=0){
            System.out.println("money不合法");
            return;
        }
        acc.setBalance(acc.getBalance()+money);
    }

    public void withDraw(Account acc,double money){
        if(money<=0 || money>acc.getBalance()){
            System.out.println("money不合法!");
            return;
        }

        acc.setBalance(acc.getBalance()-money);
    }
}
